package  
{
	import org.flixel.*;

	public class Trigger extends FlxSprite
	{
		public var trigCommands:Array;
		public var trigVariables:Array;
		
		private var counter:Number = 0;
		
		public function Trigger(x:Number, y:Number, width:Number, height:Number) 
		{
			super(x, y);
			makeGraphic(width, height, 0xff000000);
			trigCommands = new Array();
			trigVariables = new Array();
		}
		
		public function addCommand(command:String, xNum:Number, yNum:Number):void {
			trigCommands.push(command);
			trigVariables.push(new FlxPoint(xNum, yNum));
		}
		
		public function execute():void {
			for (var i:int; i < trigCommands.length; ++i) {
				if (trigCommands[i] == "cameraAt") cameraAt(trigVariables[i].x, trigVariables[i].y);
			}
		}
		
		private function cameraAt(xNum:Number, yNum:Number):void {
			Global.sideCameraToggle(xNum, yNum, 5);
		}
		
		
	}

}